package me.zhengjie.modules.website.domain;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.base.BaseEntity;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 专题内容表
 *
 * 此类表示网站的专题内容，支持主标题、副标题、内容、所属专题、状态、视频附件等字段。
 * 提供对视频集合和数据库字段之间的转换逻辑。
 *
 * @author system
 * @since 2024-12-12 11:42:51
 */
@Entity
@Data
@Table(name = "ws_topic_content")
@ApiModel(value = "Topiccontent", description = "专题内容表")
public class Topiccontent extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @Id
    @Column(name = "topic_content_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty(value = "专题内容ID", example = "1")
    private Long id;

    /**
     * 主标题
     */
    @Column(name = "main_title")
    @ApiModelProperty(value = "主标题", example = "专题主标题")
    private String mainTitle;

    /**
     * 副标题
     */
    @Column(name = "sub_title")
    @ApiModelProperty(value = "副标题", example = "专题副标题")
    private String subTitle;

    /**
     * 封面图片
     */
    @Column(name = "cover_image", columnDefinition = "TEXT")
    @ApiModelProperty(value = "封面图片URL", example = "http://example.com/image.jpg")
    private String coverImage;

    /**
     * 内容
     */
    @Column(name = "content", columnDefinition = "TEXT")
    @ApiModelProperty(value = "内容", example = "专题内容详情")
    private String content;

    /**
     * 所属专题
     */
    @Column(name = "topic_id")
    @ApiModelProperty(value = "所属专题ID", example = "1")
    private Long topicId;

    /**
     * 状态（0-禁用，1-启用）
     */
    @Column(name = "status")
    @ApiModelProperty(value = "状态", allowableValues = "0, 1", example = "1")
    private Integer status;

    /**
     * 视频附件（逗号分隔的字符串）
     */
    @Column(name = "video_attachment", columnDefinition = "TEXT")
    @ApiModelProperty(value = "视频附件", example = "video1.mp4,video2.mp4")
    private String videoAttachment;


    /**
     * 跳转链接
     */
    @Column(name = "url", columnDefinition = "TEXT")
    @ApiModelProperty(value = "跳转链接", example = "www.xxx.com")
    private String url;

    /**
     *
     */
    @Column(name = "sort_order")
    private Integer sortOrder;
}